﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin_MasterPage.master" AutoEventWireup="true" CodeFile="NhanVien.aspx.cs" Inherits="Admin_NhanVien" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
    function checkAll(obj) {
        var checkList = document.getElementsByTagName("input");
        for (var i = 0; i < checkList.length; i++) {
            if (checkList[i].type == 'checkbox' &&
	        checkList[i].id.indexOf("cb_Delete") >= 0) {
                checkList[i].checked = obj.checked;
            }
        }
    }
</script>
 <div>
        <span class="TieuDe">Danh sách Nhân viên</span><br />
        
         <asp:UpdatePanel ID="UpdatePanel1" runat="server">
     <Triggers>
     <asp:AsyncPostBackTrigger ControlID="pager" EventName="Command" />
     <asp:AsyncPostBackTrigger ControlID="btn_Delete" EventName="Click" />
     </Triggers>
        <ContentTemplate>
                            <div class="align-right" style=" margin-bottom:5px;">
                                <asp:HyperLink CssClass="button" ID="btn_ThemNhanVien" NavigateUrl="NhanVien_Them.aspx" runat="server">Thêm Nhân viên</asp:HyperLink>
                            </div>
                            <div class="clear"></div>
                    <asp:Repeater ID="rpt_NhanVien" runat="server" 
                                onitemdatabound="rpt_NhanVien_ItemDataBound" >
                        <HeaderTemplate>
                        <table width="100%" cellspacing="1" cellpadding="3" border="1">
                            <tr class="TieuDeTable" style="border-bottom-style:solid; border-bottom-width:medium; text-align:center; background-color:#f3f3f3;">
                                <td>STT</td>                              
                                <td>Tên nhân viên</td>
                                <td>Địa chỉ</td>
                                <td>Điện thoại</td>
                                <td>Email</td>
                                <td>Trạng thái</td>
                                <td align="center"><input id="chb_CheckAll" onclick="checkAll(this);" type="checkbox" />Xóa</td>
                            </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                         <tr>
                            <td><asp:Label ID="lb_STT" runat="server"></asp:Label></td>
                            <td><a href="NhanVien_Sua.aspx?id=<%#Eval("TenDangNhap_NhanVien")%>"><%#Eval("TenNhanVien")%></a></td>
                            <td><%#Eval("DiaChi") %></td>
                            <td><%#Eval("DienThoai") %></td>
                            <td><%#Eval("Email") %></td>
                            <td align="center">
                                <asp:CheckBox ID="cb_TrangThai" runat="server" Enabled="false" />
                            </td>
                            <td align="center">
                                <asp:CheckBox ID="cb_Delete" runat="server" />
                                <asp:HiddenField ID="hf_TenDangNhap" runat="server" />
                            </td>
                        </tr> 
                        </ItemTemplate>
                        <FooterTemplate>
                        </table>
                        </FooterTemplate>
                    </asp:Repeater>
<div class="clear"></div>
        <div id="pager1">
                   
                    <!--BEGIN: phan trang-->
                                
            <cc1:PagerV2_8 ID="pager" runat="server" GeneratePagerInfoSection="False"  
                FirstClause="First" Font-Underline="False"
                                     NextClause="Next" PreviousClause="Previous" 
                        ForeColor="#33CC33" Width="200" oncommand="pager_Command"/>
                
       </div>
                    
                    <!--END: phan trang--> 
                    
                    <!-- End .pagination -->
                    <div class="align-right" style="width:250px;">
                                 <div style="float:left;">
                                     <asp:Button CssClass="button" ID="btn_Delete" 
                                         runat="server" Text="Xóa" onclick="btn_Delete_Click"/></div>
                                    <div style="float:right;"><asp:Button CssClass="button" ID="btn_CapNhatTrangThai" 
                                            runat="server" Text="Cập nhật trạng thái" 
                                            onclick="btn_CapNhatTrangThai_Click" /></div>
                            </div>
            
                            
          <div class="clear"></div>
              </ContentTemplate>
     </asp:UpdatePanel>
       
 </div>
</asp:Content>

